<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Angular 使用</title>
    <script src="/static/ng/angular.js"></script>
</head>
<body ng-app="UserList" ng-controller="ListController">

<ul ng-repeat="user in users">
    <li>{{user.ip}}</li>
</ul>
<script>
    angular.module('UserList',[]).config(function ($httpProvider) {
        $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
    }).controller('ListController',function ($scope,$http) {
        $http.post("http://localhost:8081/user/toUserList.shtml").success(function (data, status, header, config) {
            $scope.users = data;

        });

    });
</script>
</body>
</html>